#tkinter模块提供了许多组件，以按钮为例
from tkinter import *
root = Tk()
booton=Button(root,text="hello")
#设置其它的通用属性
booton=Button(root,text="hello",width=10,height=5)
#设置按钮的背景颜色
booton=Button(root,text="hello",bg="red")
#设置按钮字体
booton=Button(root,text="hello",font=("微软雅黑",10))
#设置组件锚点，即设置组件的停靠位置。
booton=Button(root,text="hello",anchor=CENTER)
#组件样式：relief
button_one = Button(root, text ="Button1", relief=FLAT)
button_two = Button(root, text ="Button2", relief=RAISED)
button_three = Button(root,text ="Button3", relief=SUNKEN)
button_four = Button(root,text ="Button4", relief=GROOVE)
button_five = Button(root, text ="Button5", relief=RIDGE)
button_six = Button(root, text ="Button6", relief=SOLID)


booton.pack()
#其他的组件也是这样创建的
s=Scale(root)
s.pack()
root.mainloop()

